﻿@inherits Project.Module.View.CMS.CMSThemSanPham
@{
    ViewBag.Title = "Quản lý sản phẩm";
    Layout = "~/Views/Backend/Home/_Master.cshtml";
}
<h2>Quản Lý Sản Phẩm</h2>
<form method="post" action="/admin/admin-san-pham">
   <div>
    <table border="0">
        	<tr>
            	<td>Tên sản phẩm</td>
            	<td> <input type="text" value="" name="keywordName" /></td>
            </tr>

            <tr height="10px"></tr>
            <tr>
            	<td>Gía cả&nbsp;&nbsp;</td>
            	<td><input type="text" value="" name="keywordPrice" /></td>
            </tr>
            <tr height="10px"></tr>
            <tr>
            	<td>Số lượng&nbsp;&nbsp;</td>
            	<td><input type="text" value="" name="keywordQuantity" /></td>
            </tr>
                        <tr height="10px"></tr>
            <tr>
            	<td>Nhà cung cấp</td>
            	<td>
                    <select class="styledselect_form_1" name="keywordSupplier">
                    @if (this.listSupplier != null)
                    {
                        foreach (var item in this.listSupplier)
                        { 
                            <option value="@item.SupplierID">@item.SupplierName</option>
                        }
                    }
                    </select> 
                </td>
            </tr>
            <tr height="10px"></tr>
            <tr>
            	<td><input type="submit" value="" class="search-form" /></td>&nbsp;&nbsp;
            </tr>

   </table>
   </div>
</form>
<table height="20px"></table>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
    @if (this.listProduct != null && this.listProduct.Count > 0)
    { 
        <tr>
        <th class="table-header-repeat line-left "><a>Sản phẩm</a></th>
        <th class="table-header-repeat line-left "><a>Ngày tạo</a></th>
        <th class="table-header-repeat line-left"><a>Danh mục</a></th>
        <th class="table-header-repeat line-left"><a>Nhà cung cấp</a></th>
        <th class="table-header-repeat line-left"><a>Gía cả</a></th>
        <th class="table-header-repeat line-left"><a>Số lượng</a></th>
        <th class="table-header-repeat line-left"><a>Chỉnh sửa</a></th>
        <th class="table-header-repeat line-left"><a>Xóa</a></th>
        </tr>
        foreach (var item in this.listProduct)
        { 
            <tr>
            <td>@item.ProductName</td>
            <td>@if(item.CreatedDate != Convert.ToDateTime("01/01/1900")) {@item.CreatedDate.ToString("dd/MM/yyyy")}</td>
            <td>@item.CateName</td>
            <td>@item.SupplierName</td>
            <td>@item.priceProduct</td>
            <td>@item.quantityProduct</td>
            <td><a href="/admin/quan-ly-san-pham/edit?id=@item.ProductId">Chỉnh sửa</a></td>
            <td><a href="/admin/quan-ly-san-pham/del?id=@item.ProductId">Xóa</a></td>
            </tr>
        }
    }
</table>
<table height="20px"></table>
<input type="button" value="" class="add-form" onclick="addProduct()" />

<script type="text/jscript">
    function addProduct() {
        window.location.href = "/admin/them-san-pham";
    }
</script>


<table height="20px"></table>

